package com.hontech.bread.device.mdb


import com.hontech.bread.R
import com.hontech.bread.utils.hex16
import com.hontech.bread.utils.stringById


fun country(currencyCode: Int): String {
    val v3 = (currencyCode shr 12) and 0x0F
    val n = currencyCode and 0xFFF
    if (v3 == 0) {
        return "ITC unknown"
        //return "ITC:${v2}${v1}${v0}" // ${stringById(R.string.t1733460848_197)}
    }
    return when (n) {
        0x724 -> "Espana"
        0x156 -> stringById(R.string.t1733460848_198)
        0x250 -> "France"
        0x380 -> stringById(R.string.t1733460848_199)
        0x276 -> "Italy"
        0x978 -> "European Union"
        else -> "${stringById(R.string.t1733460848_200)}:${n.hex16()}"
    }
    //return "DCC:${v2}${v1}${v0}" // IS04217 ${stringById(R.string.t1733460848_201)}
}

fun unit(currencyCode: Int): String {
    val v3 = (currencyCode shr 12) and 0x0F
    val n = currencyCode and 0xFFF
    if (v3 == 0) {
        return "ITC unknown"
        //return "ITC:${v2}${v1}${v0}" // ${stringById(R.string.t1733460848_202)}
    }
    return when (n) {
        0x978 -> "€"
        else -> "unknown"
    }
}







